#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int m = (a - 1) / b + 1 + 10;
  int ans;
  if (m <= 480) {
    ans = 480 - m;
  } else {
    ans = 480 + 24 * 60 - m;
  }
  printf("%02d:%02d\n", ans / 60, ans % 60);
}
